package com.xinxin.o2o.dto;

import com.xinxin.o2o.enums.ShopStateEnum;
import com.xinxin.o2o.model.Shop;
import lombok.Data;

import java.util.List;

/**
 * @author 史鑫鑫
 * @date 2019-08-13 22:58
 */
@Data
public class ShopExecution {
    /**
     * 结果状态
     */
    private Integer state;

    /**
     * 状态标识
     */
    private String stateInfo;

    /**
     * 店铺数量
     */
    private Integer count;

    /**
     * 操作的Shop(增删改店铺）
     */
    private Shop shop;


    /**
     * shop列表（查询店铺列表的时候使用）
     */
    private List<Shop> shopList;

    public ShopExecution() {
    }

    /**
     * 店铺操作失败的构造器
     *
     * @param stateEnum 状态
     */
    public ShopExecution(ShopStateEnum stateEnum) {
        this.state = stateEnum.getState();
        this.stateInfo = stateEnum.getStateInfo();
    }

    /**
     * 店铺操作成功的构造器
     *
     * @param stateEnum 状态
     * @param shop      店铺
     */
    public ShopExecution(ShopStateEnum stateEnum, Shop shop) {
        this.state = stateEnum.getState();
        this.stateInfo = stateEnum.getStateInfo();
        this.shop = shop;
    }

    /**
     * @param stateEnum 状态
     * @param shopList  店铺列表
     */
    public ShopExecution(ShopStateEnum stateEnum, List<Shop> shopList) {
        this.state = stateEnum.getState();
        this.stateInfo = stateEnum.getStateInfo();
        this.shopList = shopList;
    }
}
